Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish man pages to /man/ #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WhyNotHugo
Copy link
Contributor

We'd still need to link these in the index page.

I used the pages from the latest stable release from alpine/edge. This is a lot simpler/faster than cloning the sway repository and building the whole project.

@WhyNotHugo
Copy link
Contributor Author

Failure is due to CI trying to publish the site without permission.

.build.yml Outdated Show resolved Hide resolved
@emersion
Copy link
Member

Failure is due to CI trying to publish the site without permission.

Fixed in 087bb5b

man2html.sh Outdated Show resolved Hide resolved
.build.yml Show resolved Hide resolved
oauth: pages.sr.ht/PAGES:RW
sources:
- https://github.com/swaywm/swaywm.org
packages:
- hut
- mandoc
- sway-doc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should clone the sway repo instead and run scdoc, to grab the latest version even if the package is lagging or something?

Downsides: would need to checkout the latest tag to avoid publishing docs for unreleased versions, and would need to hardcode man pages paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's more effort that it's worth. The sway-docs package on alpine/edge should not take more than a day or two to update, and this saves us having to build all of sway.

Maybe if sway had some mechanism to instruct meson to only build docs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's more effort that it's worth. The sway-docs package on alpine/edge should not take more than a day or two to update, and this saves us having to build all of sway.

Not a fan on relying on a distro to just build a man page, but I can live with that…

Maybe if sway had some mechanism to instruct meson to only build docs?

One way would be to invoke scdoc directly. Another would be to pass the list of man pages to ninja (ninja -C build/ sway.1 …), but we'd still need to pull all sway build deps.

Copy link
Contributor Author

@WhyNotHugo WhyNotHugo Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I can also just fetch the sway repo, find pages with find . -name '*.scd' and then run scdoc on them individually. Should be quite doable in a single sh script.

@emersion
Copy link
Member

Thanks for the PR! Overall looks pretty good.

@emersion
Copy link
Member

(BTW, needs a rebase)

@WhyNotHugo WhyNotHugo force-pushed the man2html branch 3 times, most recently from 2d40b73 to c8d816f Compare September 17, 2024 12:09
@WhyNotHugo
Copy link
Contributor Author

Updated and rebased

@emersion
Copy link
Member

Alright, let's just go with that approach for now. We can always change later on to something else.

Here's a sed command to linkify references inside man pages, should make it easier to navigate:

sed -E 's,<b>(sway[a-z-]*)</b>\(([0-9])\),<a href="\1.\2.html"><b>\1</b>(\2)</a>,g'

Also we should probably add a new link on the homepage linking to the man pages? Should we just link to sway(1), or sway(5), or to an HTML page listing all man pages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants